package com.lgl.scs.wx.controller;

import com.lgl.scs.base.controller.BaseController;
import com.lgl.scs.information.service.AddressService;
import com.lgl.scs.util.utils.ControllerUtil;
import com.lgl.scs.wx.service.WxServiceOrderService;
import com.lgl.scsapi.system.model.AppUser;
import com.lgl.scsapi.system.model.PageData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 移动端前台首页部分
 */
@Slf4j
@RestController
@RequestMapping(value="/wx/index")
public class WxIndexController extends BaseController {
	@Resource(name="addressService")
	private AddressService addressService;
    @Resource(name="wxServiceOrderService")
    private WxServiceOrderService wxServiceOrderService;

	//请求移动端主页的服务订单数据,暂时不考虑从redis中取数据
	@RequestMapping(value="/wxIndexPageOrder",produces="application/json;charset=UTF-8")
	public Object wxIndexPageOrder() {
		PageData mIndexPd = this.getPageData();
		AppUser loginUser = this.getSessionAppUser();
		return ControllerUtil.pageOrder(loginUser,mIndexPd,addressService,wxServiceOrderService);
	}
}